package com.sl.hx.shop.ui.mine.activity;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.sl.hx.shop.R;
import com.sl.hx.shop.base.BaseActivity;
import com.sl.hx.shop.base.BasePresenter;
import com.sl.hx.shop.bean.ProductList;
import com.sl.hx.shop.ui.mine.adapter.HistoryAdapter;
import com.sl.hx.shop.utils.UserDataManager;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class HistoryActivity extends BaseActivity {


    @BindView(R.id.mRecyclerView)
    RecyclerView mRecyclerView;

    private HistoryAdapter mHistoryAdapter;
    private List<ProductList> productLists =new ArrayList<>();

    @Override
    protected int getLayoutId() {
        return R.layout.activity_history;
    }

    @Override
    protected BasePresenter createPresenter() {
        return null;
    }

    @Override
    protected void initView() {
         productLists = UserDataManager.getHistory();
    }

    @Override
    protected void initData() {
        mHistoryAdapter = new HistoryAdapter(productLists);
        mRecyclerView.setLayoutManager(new LinearLayoutManager(mContext));
        mRecyclerView.setAdapter(mHistoryAdapter);

    }


    @OnClick({R.id.back, R.id.title})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.back:
                finish();
                break;
            case R.id.title:
                break;
        }
    }
}
